package com.ylbh.modules.userauths.controller;

import com.ylbh.common.pojo.userauth.UserAuthDTO;
import com.ylbh.common.utils.CommonResult;
import com.ylbh.common.utils.PageUtils;
import com.ylbh.common.utils.Ref;
import com.ylbh.modules.userauths.service.ShoppingUserAuthService;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 第三方绑定授权
 * @author: czx
 * @date: 2019/09/06 09:55
 */
@RestController
@RequestMapping("auth")
public class ShoppingUserAuthController {

    @Autowired
    private ShoppingUserAuthService shoppingUserAuthService;

    @ApiOperation("授权列表")
    @GetMapping("queryToGrantAuthorizationList")
    @RequiresPermissions("auth:queryToGrantAuthorizationList")
    public CommonResult queryToGrantAuthorizationList(UserAuthDTO userAuthDTO) {
        PageUtils page = shoppingUserAuthService.queryToGrantAuthorizationList(userAuthDTO);
        return Ref.ok(page);
    }
}
